#ifndef MYMAPWIDGET_H
#define MYMAPWIDGET_H

#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QFile>
#include <QTimer>


namespace Ui {
class MyMapWidget;
}

class MyMapWidget : public QWidget
{
    Q_OBJECT

public:
    explicit MyMapWidget(QWidget *parent = 0);
    ~MyMapWidget();
    void getDefaultLocation();
    void sendMapRequest();
    bool eventFilter(QObject *watched, QEvent *event);

private slots:
    void onGetDefaultLocation(QNetworkReply*);
    void onGetSearchLocation(QNetworkReply* reply);

    void on_searchBtn_clicked();

    void on_reduceBtn_clicked();

    void on_enlargeBtn_clicked();

    void ready_Read();

    void on_pushButton_clicked();

private:
    Ui::MyMapWidget *ui;
    QNetworkAccessManager m_locDefaultManager;
    QNetworkAccessManager m_mapManager;
    QNetworkAccessManager m_searchDefaultManager;
    QNetworkRequest m_request;
    QNetworkReply *m_reply;
    QString m_city;
    QString m_marker;
    QString m_scale;
    QString m_defaultloc;
    double m_lng;
    double m_lat;
    QTimer m_timer;
    QFile m_file;
    QString m_filename;

};

#endif // MYMAPWIDGET_H
